fix(ui): add a shared bg-surface-code token for the always-dark code surface#6957
Conversation
…surface The oklch(0.13 0.005 260) code-surface color was copy-pasted across 4 call sites in DiffBlock, the maintainer-panel comment preview, and try-it's request/response blocks with no shared token. Adds --surface-code to theme.css (deliberately not redefined in .dark, so it stays identical across themes) and migrates all 4 sites to the new bg-surface-code utility.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-17 15:38:37 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
oklch(0.13 0.005 260)was copy-pasted verbatim across 4 call sites in 3 unrelated files (control-primitives.tsx'sDiffBlock,maintainer-panel.tsx's comment preview, andtry-it.tsx's request/response blocks), with no shared token naming it.--surface-codetopackages/loopover-ui-kit/src/theme.css, mapped through@theme inlineas--color-surface-codeso Tailwind generates abg-surface-codeutility. Defined only in:root, deliberately not redefined inside.dark, so it renders identically regardless of the active theme (matching its "always-dark" intent).bg-[oklch(0.13_0.005_260)]arbitrary value tobg-surface-code.Test plan
apps/loopover-ui/src/components/site/surface-code-token.test.ts(new): asserts the token is defined once intheme.cssand mapped through@theme inline, asserts it is not redefined inside the.darkblock, and asserts each of the 3 call sites usesbg-surface-codewith no rawoklch(0.13...)literal remaining.npm run ui:typecheck— cleannpm run ui:lint— clean (0 errors)npm --workspace @loopover/ui run test— all existing suites pass, including the touched components' existing tests (maintainer-panel.test.tsx,try-it.test.ts)This is a pure visual no-op (same computed color, same theme behavior) — no UI screenshot included since nothing renders differently before/after.
Closes #6820